package com.nuc.ocp2;

import java.util.ArrayList;
import java.util.List;

/**
 * Time    : 2023/3/24 17:25
 * Author  : 王摇摆
 * FileName: ExerciseStore.java
 * Software: IntelliJ IDEA 2020.2.2
 * Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
 */

/**
 * 新建一个类实现书籍打折的方法
 */
public class ExerciseStore extends HighExercise {
    private List<IExercise> exerciseList = new ArrayList<>();

    public ExerciseStore() {
        this.exerciseList.add(new CountHighExercise(63d, "五年高考三年模拟数学"));
        this.exerciseList.add(new CountHighExercise(53d, "五年高考三年模拟语文"));
        this.exerciseList.add(new CountHighExercise(43d, "五年高考三年模拟英语"));
    }

    public void showExercise() {
        System.out.println("~~~~~~~~~~~~~~本店拥有的高中习题集~~~~~~~~~~~~~~~");
        System.out.println("习题名\t\t\t\t\t价格\t\t");
        exerciseList.forEach(e -> System.out.println(e.getName() + "\t\t￥" + e.getPrice() + "元\t\t"));
    }
}
